package io.renren.modules.sys.service.impl;

import io.renren.common.annotation.DataFilter;
import io.renren.modules.sys.dao.SysProjectDao;
import io.renren.modules.sys.entity.SysProjectEntity;
import io.renren.modules.sys.service.SysProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service("sysProjectService")
public class SysProjectServiceImpl implements SysProjectService {
    @Autowired
    private SysProjectDao sysProjectDao;

    @Override
    public void save(SysProjectEntity project) {
        sysProjectDao.save(project);

    }

    @Override
    public void update(SysProjectEntity project) {
        sysProjectDao.update(project);

        System.out.println("SERVupdate()");
    }

    @Override
    public int delete(Long projectId) {
        System.out.println("SERVdelete()");
        return sysProjectDao.delete(projectId);
    }

    @Override
    public SysProjectEntity queryObject(Long projectId) {
        System.out.println("SERVqueryObject()");
        return sysProjectDao.queryObject(projectId);
    }

    @Override
    @DataFilter(tableAlias = "p", user = false)
    public List<SysProjectEntity> queryList(Map<String, Object> map) {
        System.out.println("SERVqueryList()");
        return sysProjectDao.queryList(map);
    }


    @Override
    public int queryTotal() {
        System.out.println("SERVqueryTotal()");
        return sysProjectDao.queryTotal();
    }
}
